package com.jiangjiang.eshop.common.runner;

import com.jiangjiang.eshop.schedule.stock.ScheduleStockUpdateMessageConsumer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @ClassName SystemInitRunner
 * @Description TODO
 * @Author jhw
 * @Date 2021/9/8 17:24
 * @Version 1.0
 **/
@Slf4j
@Component
public class SystemInitRunner implements ApplicationRunner {

    @Autowired
    private ScheduleStockUpdateMessageConsumer scheduleStockUpdateMessageConsumer;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info(">>>>> 开始启动调度库存消费线程");
        scheduleStockUpdateMessageConsumer.start();
    }
}
